<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>抽奖</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html, body {
            height: 100%;
            overflow: hidden;
        }
        body {
            background: url(image/bg.png);
            color: white;
        }
        .circle {
            position: absolute;
            width: 56%;
            left: 22%;
            top: 25%;
        }
        .circle .cir-bg {
            width: 100%;
        }
        .logo {
            position: absolute;
            width: 21%;
            top: 3%;
            right: 3%;
        }
        .chou {
            position: absolute;
            width: 32%;
            left: 34%;
            top: 50%;
            transform: translateY(-50%);
        }
        .tip {
            position: absolute;
            font-size: 13px;
            text-align: center;
            width: 100%;
            margin-top: 13%;
        }
        .bottom {
            position: absolute;
            bottom: 5%;
            width: 100%;
            padding: 0 6%;
            box-sizing: border-box;
            display: table;
        }
        .bottom .icon {
            width: 10vh;
            height: 10vh;
            border: 2px solid #C1E2E9;
            display: table-cell;
            box-sizing: border-box;
        }
        .bottom .user {
            display: table-cell;
            border: 2px solid #C1E2E9;
            border-radius: 5px;
            width: 75%;
            height: 100%;
            padding: 0 3%;
            vertical-align: middle;
            font-size: 24px;
        }
    </style>
</head>
<body>
    <div>
        <div class="circle">
            <a href="#" onclick="javascript:chou()">
            <img class="cir-bg" src="image/circle.png" />
            <img class="chou" src="image/chou.png" />
            </a>
            <div class="tip">点击上方按钮开始抽奖</div>
        </div>
        <img class="logo" src="image/logo.png" />
        <div class="bottom">
            <img class="icon" src="#" />
            <div class="user"></div>
        </div>
    </div>
    <script>
    var flag = false;
    function chou() {
        if(flag) return;
        var http = new XMLHttpRequest();
        http.open("GET", "http://h5app.7dyk.com/chencong/test4/choujiang.php", true);
        http.onreadystatechange = function() {
            if (http.readyState == 4 && http.status == 200) {
                var json = JSON.parse(http.responseText);
                document.querySelector(".icon").src = json.headimgurl;
                document.querySelector(".user").innerHTML = json.nickname;
                flag = true;
            }
        }
        http.send(null);
    }
    </script>
</body>
</html>